﻿/**
 * Peter
 * Created by: Peter Development Team
 *    http://peter.codeplex.com/
 * 
 * GNU General Public License version 2 (GPLv2)
 *    http://peter.codeplex.com/license
 *
 *  This code is provided on an AS IS basis, with no WARRANTIES,
 *  CONDITIONS or GUARANTEES of any kind.
 *
 **/

using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel.Composition;
using System.Windows.Threading;
using Irony.Parsing;
using Peter.Common.Code;

namespace Peter.Logic.IronyGrammers
{
   /// <summary>
   /// Parses the grammar tree for Ruby
   /// </summary>
   [Export (typeof (IGrammarTreeParser))]
   [ExportMetadata ("Extensions", ".rb")]
   public class RubyGrammarTreeParser : IGrammarTreeParser
   {
      private Dispatcher m_Dispatcher;
      private Collection<BaseCodeItem> m_CodeStructure;

      /// <summary>
      /// Called to parse the given tree. This is called from a worker thread.
      /// </summary>
      /// <param name="tree">Tree to parse</param>
      /// <param name="dispatcher">Thread dispatcher.</param>
      public IEnumerable<BaseCodeItem> ParseTree (ParseTree tree, Dispatcher dispatcher)
      {
         this.m_Dispatcher = dispatcher;
         this.m_CodeStructure = new Collection<BaseCodeItem> ();
         return this.m_CodeStructure;
      }
   }
}
